<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

</head>
<body>
<div  style="width:40%;float:right">
	            <fieldset style="width: 50%">
	               <legend>添加管理员</legend>
                     name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="aname"><br> 
				     pasword&nbsp;<input type="password" name="apassword"><br> 
                    author&nbsp;&nbsp;<input type="text" name="author"><br>
				 <button type="submit" class="addAd">add<tton>
				   </fieldset>
				</div>
				
      <table id="stus" class="table table-striped  table-hover">
    	<tr><th>id</th><th>name</th><th>password</th><th>author</th></tr>
    </table>
    <script>
	var stus=$("#stus");
    $(".addAd").click(function(){
        var aname=$("input[name=aname]").val();
        var apassword=$("input[name=apassword]").val();
        var author=$("input[name=author]").val();
        var data={aname:aname,apassword:apassword,author:author};
      $.ajax("addManager",{
            method:"POST",
            type:"json",
            data:data,
            success:function(d){
            	$("<tr></tr>").append($("<td></td>").text(d.aid))
            	.append($("<td></td>").text(d.aname)).append($("<td></td>").text(d.apassword)).append($("<td></td>").text(d.author)).appendTo(stus);
            }
        });
    });
    
     
</script>
	 


</body>
</html>